suppressMessages(library(Signac))
suppressMessages(library(Seurat))
suppressMessages(library(tidyverse))
suppressMessages(library(data.table))
suppressMessages(library(RColorBrewer))
suppressMessages(library(readxl))
library(harmony)
library(SeuratWrappers)
Loading required package: Rcpp
panc <- readRDS('/diskmnt/Projects/SenNet_analysis/Main.analysis/merged/merge_SBR_RNA_1/17_Mouse_Merged_normalized_SBR_2_10_26_weeks.rds')
setwd('/diskmnt/Projects/SenNet_analysis/Main.analysis/merged/merge_SBR_RNA_1/upd.cell.type/')
DimPlot(panc, group.by = 'seurat_clusters', label = TRUE, raster = T)
ggsave('Dimplot_clusters.pdf', width = 7, height = 5)
Rasterizing points since number of points exceeds 100,000. To disable this behavior set `raster=FALSE`
options(repr.plot.width=8, repr.plot.height=7)
DimPlot(panc, group.by = 'Timepoint.weeks', label = TRUE, raster = T)
DimPlot(panc, group.by = 'Cohort', label = TRUE, raster = T)
Rasterizing points since number of points exceeds 100,000. To disable this behavior set `raster=FALSE` Rasterizing points since number of points exceeds 100,000. To disable this behavior set `raster=FALSE`
panc$Mouse_ID %>% table()
. 7248 7249 7251 7254 7259 7260 7352 7353 7354 7357 7361 7434 7435 6660 8171 5120 5231 2861 6391 12937 16472 18134 15188 9480 11497 7887 7448 7450 7452 7548 7615 6873 9773 12322
options(repr.plot.width=8, repr.plot.height=7)
panc$predicted_doublet[is.na(panc$predicted_doublet)] <- NA
DimPlot(object = panc, group.by = 'predicted_doublet',cols = c('black', 'yellow'), raster = T,
label=FALSE,label.size=6)
ggsave( "Dimplot_predicted_doublets.pdf",
height=6,width=8,useDingbats=FALSE,limitsize = FALSE)
options(repr.plot.width=14, repr.plot.height=7)
Rasterizing points since number of points exceeds 100,000. To disable this behavior set `raster=FALSE`
degs <- fread('/diskmnt/Projects/Users/allakarpova/Data/markers/Liver_mouse_markers.txt')
genes2plot <- degs$`Gene symbol` %>% unique()
p <- DotPlot(object = panc, group.by = 'seurat_clusters', features = genes2plot, col.min = 0, dot.min = 0.01, assay = 'RNA' )
p$data <- merge(p$data, degs[,c(1,5)], by.x = 'features.plot', by.y = 'Gene symbol', all.x=T)
p <- p + RotatedAxis()
p <- p + facet_wrap(~ Cell.type , scales = "free", drop = T, ncol = 3)
p <- p + theme(panel.spacing = unit(0, "lines"),
strip.background = element_blank(),
panel.border = element_rect(colour = "black"),
panel.grid.major = element_line(colour = "grey80"),
strip.text.x = element_text(angle = 00, vjust = 0.5, hjust = 0.5, size = 14),
axis.text.x = element_text(size = 15, face = "bold", angle = 90, hjust = 1, vjust = 0.5),
strip.placement = "outside")
p <- p + scale_color_viridis_c("viridis", direction = 1) +
scale_size_area(limits=c(0,40), oob=scales::squish)
ggsave('Dotplot_markers.pdf', width = 30, height =30, useDingbats = F)
options(repr.plot.width=14, repr.plot.height=24)
p
Warning message in FetchData.Seurat(object = object, vars = features, cells = cells): “The following requested variables were not found: Gstp-ps, Mug-ps1, mt-Rnr1, mt-Rnr2, Sdpr, Cyr61” Scale for colour is already present. Adding another scale for colour, which will replace the existing scale. Scale for size is already present. Adding another scale for size, which will replace the existing scale. Warning message: “Removed 1424 rows containing missing values or values outside the scale range (`geom_point()`).” Warning message: “Removed 1424 rows containing missing values or values outside the scale range (`geom_point()`).”
mouse_human_genes <- read.csv("http://www.informatics.jax.org/downloads/reports/HOM_MouseHumanSequence.rpt",sep="\t")
# separate human and mouse
mouse <- split.data.frame(mouse_human_genes,mouse_human_genes$Common.Organism.Name)[[2]]
human <- split.data.frame(mouse_human_genes,mouse_human_genes$Common.Organism.Name)[[1]]
# remove some columns
mouse <- mouse[,c(1,4)]
human <- human[,c(1,4)]
mh_data <- merge.data.frame(mouse,human,by = "DB.Class.Key",all.y = TRUE, suffixes = c('.mouse', '.human'))
head(mh_data)
myeloid.genes <- fread('/diskmnt/Projects/Users/allakarpova/Data/markers/Cell_state_markers_v10172022.txt', data.table = F, header = T)
myeloid.genes <- myeloid.genes %>% left_join(mh_data[,-1], by=c('Gene'='Symbol.human'))
genes2plot <- myeloid.genes$Symbol.mouse %>% unique()
p <- DotPlot(object = panc, group.by = 'seurat_clusters', features = genes2plot, col.min = 0, dot.min = 0.01, assay = 'RNA', cluster.idents = TRUE)
p$data <- merge(p$data, myeloid.genes[c(1:3, 6)], by.x = 'features.plot', by.y = 'Symbol.mouse', all.x=T)
p <- p + RotatedAxis()
p <- p + facet_wrap(~Gene_set_group + Gene_set , scales = "free", drop = T, ncol = 7)
p <- p + theme(panel.spacing = unit(0, "lines"),
strip.background = element_blank(),
panel.border = element_rect(colour = "black"),
panel.grid.major = element_line(colour = "grey80"),
strip.text.x = element_text(angle = 00, vjust = 0.5, hjust = 0.5, size = 14),
axis.text.x = element_text(size = 15, face = "bold", angle = 90, hjust = 1, vjust = 0.5),
strip.placement = "outside")
p <- p + scale_color_viridis_c("viridis", direction = 1) +
scale_size_area(limits=c(0,40), oob=scales::squish)
ggsave(paste0( "Dotplot_marker_human_gene_expression_RNA.pdf"),plot = p,
height=180,width=50,useDingbats=FALSE,limitsize = FALSE)
| DB.Class.Key | Symbol.mouse | Symbol.human | |
|---|---|---|---|
| <int> | <chr> | <chr> | |
| 1 | 48503904 | Aldh1l1 | ALDH1L1 |
| 2 | 48503905 | Sry | SRY |
| 3 | 48503906 | Fry | FRY |
| 4 | 48503907 | Rpe65 | RPE65 |
| 5 | 48503908 | Ywhae | YWHAE |
| 6 | 48503909 | Camkv | CAMKV |
Warning message in left_join(., mh_data[, -1], by = c(Gene = "Symbol.human")): “Each row in `x` is expected to match at most 1 row in `y`. ℹ Row 7 of `x` matches multiple rows. ℹ If multiple matches are expected, set `multiple = "all"` to silence this warning.” Warning message in FetchData.Seurat(object = object, vars = features, cells = cells): “The following requested variables were not found (10 out of 29 shown): NA, Mrgpra7, Mrgpra5, H2-Ea, Vpreb1b, Vpreb1a, Ighg2a, Ighg, Siglecl2, Cd200r1l” Scale for colour is already present. Adding another scale for colour, which will replace the existing scale. Scale for size is already present. Adding another scale for size, which will replace the existing scale. Warning message: “Removed 41776 rows containing missing values or values outside the scale range (`geom_point()`).”
degs <- read_excel('/diskmnt/Projects/Users/allakarpova/Data/markers/41467_2018_6318_MOESM5_ESM_formatted.xlsx',
col_names = T)
degs <- degs %>% left_join(mh_data[,-1], by=c('Gene'='Symbol.human'))
degs
genes2plot <- degs$Symbol.mouse %>% unique()
p <- DotPlot(object = panc, group.by = 'seurat_clusters', features = genes2plot, col.min = 0, dot.min = 0.01, assay = 'RNA', cluster.idents = TRUE)
p$data <- merge(p$data, degs[c(4,3)], by.x = 'features.plot', by.y = 'Symbol.mouse', all.x=T)
p <- p + RotatedAxis()
p <- p + facet_wrap(~ Cell_type , scales = "free", drop = T, ncol = 3)
p <- p + theme(panel.spacing = unit(0, "lines"),
strip.background = element_blank(),
panel.border = element_rect(colour = "black"),
panel.grid.major = element_line(colour = "grey80"),
strip.text.x = element_text(angle = 00, vjust = 0.5, hjust = 0.5, size = 14),
axis.text.x = element_text(size = 15, face = "bold", angle = 90, hjust = 1, vjust = 0.5),
strip.placement = "outside")
p <- p + scale_color_viridis_c("viridis", direction = 1) +
scale_size_area(limits=c(0,40), oob=scales::squish)
ggsave(paste0( "Dotplot_20human_liver_paper_markers_gene_expression_RNA.pdf"),
plot = p, height=70,width=20,useDingbats=FALSE,limitsize = FALSE)
Warning message in left_join(., mh_data[, -1], by = c(Gene = "Symbol.human")): “Each row in `x` is expected to match at most 1 row in `y`. ℹ Row 14 of `x` matches multiple rows. ℹ If multiple matches are expected, set `multiple = "all"` to silence this warning.”
| Gene | Cluster | Cell_type | Symbol.mouse |
|---|---|---|---|
| <chr> | <chr> | <chr> | <chr> |
| HSD11B1 | Cluster1 | Hep1 | Hsd11b1 |
| APOM | Cluster1 | Hep1 | Apom |
| PON3 | Cluster1 | Hep1 | Pon3 |
| TTC36 | Cluster1 | Hep1 | Ttc36 |
| BCHE | Cluster1 | Hep1 | Bche |
| F10 | Cluster1 | Hep1 | F10 |
| APOC4-APOC2 | Cluster1 | Hep1 | NA |
| GOLT1A | Cluster1 | Hep1 | Golt1a |
| ADH1A | Cluster1 | Hep1 | Adh1 |
| AQP9 | Cluster1 | Hep1 | Aqp9 |
| G6PC | Cluster1 | Hep1 | NA |
| PROX1 | Cluster1 | Hep1 | Prox1 |
| RCAN1 | Cluster1 | Hep1 | Rcan1 |
| HAMP | Cluster1 | Hep1 | Hamp2 |
| HAMP | Cluster1 | Hep1 | Hamp |
| GPD1 | Cluster1 | Hep1 | Gpd1 |
| CTH | Cluster1 | Hep1 | Cth |
| TKFC | Cluster1 | Hep1 | Tkfc |
| G0S2 | Cluster1 | Hep1 | G0s2 |
| GHR | Cluster1 | Hep1 | Ghr |
| ABCC2 | Cluster1 | Hep1 | Abcc2 |
| CD2 | Cluster2 | a/b T-cells | Cd2 |
| TRAC | Cluster2 | a/b T-cells | Trac |
| CD3D | Cluster2 | a/b T-cells | Cd3d |
| CCL5 | Cluster2 | a/b T-cells | Ccl5 |
| TRBC2 | Cluster2 | a/b T-cells | Trbc1 |
| TRBC2 | Cluster2 | a/b T-cells | Trbc2 |
| GZMA | Cluster2 | a/b T-cells | Gzma |
| CD3E | Cluster2 | a/b T-cells | Cd3e |
| IL7R | Cluster2 | a/b T-cells | Il7r |
| ⋮ | ⋮ | ⋮ | ⋮ |
| PRDX2 | Cluster19 | Erythroid cells | Prdx2 |
| GABARAPL2 | Cluster19 | Erythroid cells | Gabarapl2 |
| RAD23A | Cluster19 | Erythroid cells | Rad23a |
| FBXO7 | Cluster19 | Erythroid cells | Fbxo7 |
| CA2 | Cluster19 | Erythroid cells | Car2 |
| HBD | Cluster19 | Erythroid cells | Hbb-bh2 |
| HBD | Cluster19 | Erythroid cells | Hbb-bt |
| HBD | Cluster19 | Erythroid cells | Hbb-bs |
| HBD | Cluster19 | Erythroid cells | Hbb-b2 |
| HBD | Cluster19 | Erythroid cells | Hbb-b1 |
| ACTA2 | Cluster20 | Hepatic stellate cells | Acta2 |
| DCN | Cluster20 | Hepatic stellate cells | Dcn |
| MYL9 | Cluster20 | Hepatic stellate cells | Myl9 |
| COL3A1 | Cluster20 | Hepatic stellate cells | Col3a1 |
| COL1A2 | Cluster20 | Hepatic stellate cells | Col1a2 |
| COL1A1 | Cluster20 | Hepatic stellate cells | Col1a1 |
| OLFML3 | Cluster20 | Hepatic stellate cells | Olfml3 |
| TAGLN | Cluster20 | Hepatic stellate cells | Tagln |
| BGN | Cluster20 | Hepatic stellate cells | Bgn |
| TPM2 | Cluster20 | Hepatic stellate cells | Tpm2 |
| COLEC11 | Cluster20 | Hepatic stellate cells | Colec11 |
| LUM | Cluster20 | Hepatic stellate cells | Lum |
| NEXN | Cluster20 | Hepatic stellate cells | Nexn |
| COL14A1 | Cluster20 | Hepatic stellate cells | Col14a1 |
| GGT5 | Cluster20 | Hepatic stellate cells | Ggt5 |
| IGFBP7 | Cluster20 | Hepatic stellate cells | Igfbp7 |
| ASPN | Cluster20 | Hepatic stellate cells | Aspn |
| COL6A2 | Cluster20 | Hepatic stellate cells | Col6a2 |
| COL4A2 | Cluster20 | Hepatic stellate cells | Col4a2 |
| THBS2 | Cluster20 | Hepatic stellate cells | Thbs2 |
Warning message in FetchData.Seurat(object = object, vars = features, cells = cells): “The following requested variables were not found (10 out of 21 shown): NA, Golt1a, Lyz3, H2-Ea, S100a11-ps, Cstdc3, Tmsb10b, Clec7a, Idi1-ps1, Ighg2a” Scale for colour is already present. Adding another scale for colour, which will replace the existing scale. Scale for size is already present. Adding another scale for size, which will replace the existing scale. Warning message: “Removed 10671 rows containing missing values or values outside the scale range (`geom_point()`).”
myeloid.genes
| Gene_set_group | Gene_set | Gene | Expression_direction | Common_name | Symbol.mouse |
|---|---|---|---|---|---|
| <chr> | <chr> | <chr> | <chr> | <chr> | <chr> |
| Immune | TAMs | PIK3CG | Pik3cg | ||
| Immune | TAMs | ARG1 | Arg1 | ||
| Immune | TAMs | IL6 | Il6 | ||
| Immune | TAMs | IL10 | Il10 | ||
| Immune | TAMs | PDGFB | Pdgfb | ||
| Immune | TAMs | TGFB1 | Tgfb1 | ||
| Immune | TAMs | CCL2 | Ccl12 | ||
| Immune | TAMs | CCL2 | Ccl2 | ||
| Immune | TAMs | IL23A | Il23a | ||
| Immune | TAMs | IL17A | Il17a | ||
| Immune | TAMs | CD163 | Cd163 | ||
| Immune | TAMs | MRC1 | Mrc1 | ||
| Immune | TAMs | MMP2 | Mmp2 | ||
| Immune | TAMs | MMP9 | Mmp9 | ||
| Immune | TAMs | VTCN1 | Vtcn1 | ||
| Immune | Pan-Immune | PTPRC | CD45 | Ptprc | |
| Immune | Granulocyte | FUT4 | CD15 | Fut4 | |
| Immune | Granulocyte | CLC | NA | ||
| Immune | Granulocyte | MS4A3 | Ms4a3 | ||
| Immune | Granulocyte | PI3 | NA | ||
| Immune | Granulocyte | TCN1 | NA | ||
| Immune | Granulocyte | CPA3 | Cpa3 | ||
| Immune | Granulocyte | HDC | Hdc | ||
| Immune | Granulocyte | GATA2 | Gata2 | ||
| Immune | Granulocyte | CXCL8 | NA | ||
| Immune | Granulocyte | GATA1 | Gata1 | ||
| Immune | Granulocyte | MS4A2 | Ms4a2 | ||
| Immune | Granulocyte | SIGLEC8 | Siglecf | ||
| Immune | Granulocyte | SIGLEC8 | Siglece | ||
| Immune | Mast | PLAU | Plau | ||
| ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
| Normal cells | Osteoblasts early | DLX5 | Dlx5 | ||
| Normal cells | Osteoblasts early | SATB2 | Satb2 | ||
| Normal cells | Osteoblasts early | ALPL | Alpl | ||
| Normal cells | Osteoblasts early | COL1A1 | Col1a1 | ||
| Normal cells | Osteoblasts early | COL1A2 | Col1a2 | ||
| Normal cells | Osteocyte | PDPN1 | NA | ||
| Normal cells | Osteocyte | PHEX | Phex | ||
| Normal cells | Osteocyte | DMP1 | Dmp1 | ||
| Normal cells | Osteocyte | CAPG | Capg | ||
| Normal cells | Osteocyte | MEPE | Mepe | ||
| Normal cells | Osteocyte | SOST | Sost | ||
| Normal cells | Chondrocyte | SOX9 | Sox9 | ||
| Normal cells | Chondrocyte | COMP | Comp | ||
| Normal cells | Chondrocyte | ACAN | Acan | ||
| Normal cells | Chondrocyte | SOX5 | Sox5 | ||
| Normal cells | Chondrocyte | SOX6 | Sox6 | ||
| Normal cells | Mesothelial cells | KRT19 | Krt19 | ||
| Normal cells | Mesothelial cells | MSLN | Msln | ||
| Normal cells | Mesothelial cells | PDPN | Pdpn | ||
| Tumor | ccRCC_Tumor | CA9 | Car9 | ||
| Tumor | ccRCC_Tumor | CD24 | Cd24a | ||
| Tumor | ccRCC_Tumor | LTL | NA | ||
| Tumor | ccRCC_Tumor | PAX2 | Pax2 | ||
| Tumor | ccRCC_Tumor | PAX8 | Pax8 | ||
| Tumor | ccRCC_Tumor | VEGFA | Vegfa | ||
| Tumor | ccRCC_Tumor | COL23A1 | Col23a1 | ||
| Tumor | ccRCC_Tumor | CP | Cp | ||
| Tumor | ccRCC_Tumor | ENPP3 | Enpp3 | ||
| Tumor | ccRCC_Tumor | NDRG1 | Ndrg1 | ||
| Tumor | ccRCC_Tumor | SHISA9 | Shisa9 |
options(repr.plot.width=15, repr.plot.height=7)
panc@meta.data %>% ggplot(aes(x = seurat_clusters, fill = predicted_doublet)) +
geom_bar(stat = 'count', position = 'fill')
doublet.clusters <- panc@meta.data %>%
group_by(seurat_clusters, predicted_doublet) %>%
tally() %>%
group_by(seurat_clusters) %>%
mutate(pct = n/sum(n)) %>%
filter(predicted_doublet, pct > 0.5) %>%
pull(seurat_clusters)
doublet.clusters
liver.cell.types <- c('Hepatocytes' = '#2F8AC4',
'Cholangiocytes' = '#52BCA3',
'Doublet' = 'yellow',
'Central venous LSECs' = '#ED645A',
'Periportal LSECs' = '#E58606',
'Portal endothelial cells' = '#DAA51B',
'LSECs' = '#ED645A',
'Lymphatic endothelial cells'='#99C945',
'Noninflammatory macs' = '#5D69B1',
'Kupffer cells' = '#5D69B1',
'Inflammatory macs' = '#764E9F',
'Portal fibroblasts' = '#CC61B0',
'Hepatic stellate cells' = '#CC3A8E',
'vSMCs' = '#24796C',
'Pericytes' = '#0F8554',
'Mesothelial cells' = '#A5AA99',
'NK cells' = '#ede5cf',
'T-cells' = '#6b705c',
'B-cells' = '#e0c2a2',
'Plasma' = '#d39c83',
'Mast' = '#c1766f',
'pDC' = '#a65461',
'Monocytes' = '#813753',
'cDC2' = '#541f3f',
'DC' = '#541f3f',
'mregDC'= '#8C785D')
DefaultAssay(panc) = 'SCT'
panc@meta.data$cell_type_merged <- case_when(panc$predicted_doublet ~ 'Doublet',
panc$seurat_clusters %in% doublet.clusters ~ 'Doublet',
panc$seurat_clusters %in% c(26) ~ 'Doublet',
panc$seurat_clusters %in% c(0,41, 14,17, 6,8,10,11, 20,21,27,2,9,19, 4,18,35, 28, 32) ~ 'Hepatocytes',
panc$seurat_clusters %in% c(1,3) ~ 'Hepatic stellate cells',
panc$seurat_clusters %in% c(38) ~ 'Pericytes',
panc$seurat_clusters %in% c(5) ~ 'Kupffer cells',
panc$seurat_clusters %in% c(23) ~ 'Inflammatory macs',
panc$seurat_clusters %in% c(12,13,15) ~ 'Cholangiocytes',
panc$seurat_clusters %in% c(7,16,22, 29) ~ 'LSECs',
#panc$seurat_clusters %in% c(29) ~ 'Periportal LSECs',
panc$seurat_clusters %in% c(24,43) ~ 'T-cells',
panc$seurat_clusters %in% c(45) ~ 'Mesothelial cells',
panc$seurat_clusters %in% c(30) ~ 'B-cells', # not plasma
panc$seurat_clusters %in% c(25) ~ 'DC', #not B-cells
panc$seurat_clusters %in% c(39) ~ 'cDC2', #not B-cells
panc$seurat_clusters %in% c(32, 44) ~ 'Proliferating',
panc$seurat_clusters %in% c(46) ~ 'Adipocytes',
panc$seurat_clusters %in% c(48) ~ 'Neurons',
panc$seurat_clusters %in% c(47) ~ 'Skeletal muscle',
TRUE ~ 'Unknown')
options(repr.plot.width=14, repr.plot.height=7)
DimPlot(object = panc,raster=T, group.by = 'cell_type_merged',cols = liver.cell.types,
label=TRUE,label.size=4)
ggsave( "Dimplot_cell_type_merged.pdf",
height=6,width=10,useDingbats=FALSE,limitsize = FALSE)
panc@meta.data %>% count(seurat_clusters, cell_type_merged) %>% filter(cell_type_merged=='Unknown')
Rasterizing points since number of points exceeds 100,000. To disable this behavior set `raster=FALSE`
| seurat_clusters | cell_type_merged | n |
|---|---|---|
| <fct> | <chr> | <int> |
| 49 | Unknown | 71 |
fwrite((panc@meta.data %>% select(cell_type_merged)),
'17_Mouse_Merged_normalized_SBR_2_10_26_weeks_02032025.tsv', sep = '\t', row.names = TRUE)
mouse.liver.cell.types <- c('Hepatocytes' = '#2F8AC4',
'Proliferating' = "#a9d6e5",
'Cholangiocytes' = '#52BCA3',
'Central venous LSECs' = '#e92e20',
'Mid lobular LSECs' = '#ED645A',
'Periportal LSECs' = '#E58606',
'Portal endothelial cells' = '#DAA51B',
'Vascular endothelial cells' = '#ffb703',
'Lymphatic endothelial cells'='#99C945',
'Kupffer cells' = '#5D69B1',
'Inflammatory macs' = '#764E9F',
'Portal fibroblasts' = '#CC61B0',
'Hepatic stellate cells' = '#CC3A8E',
'Tumor fibroblasts' = '#94346E',
'vSMCs' = '#24796C',
'Pericytes' = '#0F8554',
'Mesothelial cells' = '#A5AA99',
'NK cells' = '#ede5cf',
'T-cells' = '#6b705c',
'B-cells' = '#e0c2a2',
'Plasma' = '#d39c83',
'Mast' = '#c1766f',
'pDC' = '#a65461',
'Monocytes' = '#813753',
'Adipocytes' = '#DCB0F2',
'Skeletal muscle' = '#C9DB74',
'Neurons' = '#E73F74',
'Unknown' = 'grey',
'cDC2' = '#541f3f',
'DC'= '#8C785D')
setwd('/diskmnt/Projects/SenNet_analysis/Main.analysis/merged/merge_SBR_RNA_1/no_doublets')
obj <- readRDS('/diskmnt/Projects/SenNet_analysis/Main.analysis/merged/merge_SBR_RNA_1/no_doublets/17_Mouse_Merged_normalized_SBR_2_10_26_weeks_no_doublet.rds')
meta <- fread('/diskmnt/Projects/SenNet_analysis/Main.analysis/data_freeze/v1.1/metadata/17_Mouse_Merged_normalized_SBR_2_10_26_weeks_03052025.tsv', header = T) %>%
column_to_rownames('V1')
head(meta)
| cell_type_broad | cell_type_sen | cell_type_sen2 | |
|---|---|---|---|
| <chr> | <chr> | <chr> | |
| SR006342_sbr_7448_Male_10_AAACCCAAGAAGCCAC-1 | Portal fibroblasts | Portal fibroblasts | Portal fibroblasts |
| SR006342_sbr_7448_Male_10_AAACCCAAGCCATTTG-1 | T-cells | T-cells | T-cells |
| SR006342_sbr_7448_Male_10_AAACCCACACGCGGTT-1 | Hepatic stellate cells | Activating HSCs | Activating HSCs |
| SR006342_sbr_7448_Male_10_AAACCCACATTAAGCC-1 | Hepatocytes | Hepatocytes Zone 1/2 | Hepatocytes |
| SR006342_sbr_7448_Male_10_AAACCCAGTATCCCAA-1 | Cholangiocytes | Cholangiocytes | Cholangiocytes |
| SR006342_sbr_7448_Male_10_AAACCCATCAGAATAG-1 | Cholangiocytes | Cholangiocytes | Cholangiocytes |
obj <- AddMetaData(obj, meta)
options(repr.plot.width=15, repr.plot.height=10)
DimPlot(obj, group.by = 'cell_type_broad', cols = mouse.liver.cell.types, raster=T, label = TRUE) +
coord_fixed()
ggsave('Dimplot_cell_type_broad.pdf', width = 13, height = 8, useDingbats = F)
Rasterizing points since number of points exceeds 100,000. To disable this behavior set `raster=FALSE`
dim(obj)